/**
 * File name:      IDataBaseDao.java
 * Date:           2013-3-25
 * Description:    // 用于详细说明此程序文件完成的主要功
 *                 // 能与其他模块或函数的接口，输出值、
 *                 // 取值范围、含义及参数间的关系
 * Modify History:     Date             Programmer       Notes
 *                    ---------        ---------------  ---------
 *                    2013-3-25            伍冲                              Initial
 **********************************************************************/
package com.wy.framework.dao;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.orm.hibernate4.HibernateTemplate;

import com.wy.framework.pojos.TSysDbRouter;

/**
 * Created on 2013-3-25
 * <p>Title:       数据集成层数据库操纵接口/p>
 * <p>Description: 据库操纵接口</p>
 * @version        1.0
 */
public interface IDataBaseDao {
	public HibernateTemplate getHibernateTemplate();
	public void flush()throws ErrorSqlException;
	public void refresh(Object transientObject)throws ErrorSqlException;
	public void save(Object transientObject) throws ErrorSqlException;
	public void delete(Object transientObject) throws ErrorSqlException;
	public void delete(Class className, Serializable pk) throws ErrorSqlException;
	public void update(Object transientObject) throws ErrorSqlException;
	public void update(String sqlKey, List<Object> params) throws ErrorSqlException;
	public void update(String sqlKey) throws ErrorSqlException;
	public void update(String sqlKey, String key) throws ErrorSqlException;
	public void saveOrUpdate(Object transientObject) throws ErrorSqlException;
	public Object load(Class className, Serializable pk) throws ErrorSqlException;
	public JdbcTemplate getJdbcTemplate();
	public String getDatabaseTypeName();
	public JdbcTemplate getJdbcTemplateDistribute(TSysDbRouter tSysDbRouter);
	public JdbcTemplate getJdbcTemplateDistributeByIpSegment(String ips);
	public void execute(String statement) throws ErrorSqlException;
	public int queryForInt(String sqlKey,List<Object> params) throws ErrorSqlException;
	public List queryNoKeyForList(String sqlstr, List<Object> params) throws ErrorSqlException;
	public List queryForList(String sqlKey,List<Object> params) throws ErrorSqlException;
	public List queryForList(String sqlKey,String param) throws ErrorSqlException;
	public List queryForListIn(String sqlKey,List<Object> param,String inStr) throws ErrorSqlException;
	public List queryForList(String sqlKey) throws ErrorSqlException;
	public List queryForListOrder(String sqlKey, List<Object> params, String orderSql) throws ErrorSqlException;
	public List queryForList(String sqlKey,List<Object> params,String sqlstr) throws ErrorSqlException;
	public List<Map> queryForPage(String sqlKey,List<Object> params,int pageNum,int rowNumPerPage) throws ErrorSqlException;
	public List<Map> query(String sqlKey,List<Object> params,RowMapper rm) throws ErrorSqlException;
	public List queryByJdbcByJdbcTemplate(String sql, Object[] params, final Class[] clz) throws DataAccessException, ErrorSqlException;
	List queryForListReplaceStr(String sqlKey, List<Object> params,
			Map replaceStrMap) throws ErrorSqlException;
	public String getSql(String string);
	List queryForListAuchan(String sqlKey, List<Object> params,
			JdbcTemplate jdbcTemplate) throws ErrorSqlException;
	List queryForListAuchan(String sqlKey, List<Object> params,
			JdbcTemplate jdbcTemplate, String appendSql)
			throws ErrorSqlException;
	
	/**
	 * 
	 * Function Name               querySQLByPage                                   
	 * @param sqlKey
	 * @param pageSize
	 * @param pageNum
	 * @param conditionSql
	 * @param params
	 * @return
	 * @throws Exception          		             
	 * @description 多条件分页查询方法
	 * Modify History:              Date             Programmer       Notes
	 *                            ---------        ---------------  ---------
	 *                      2016-5-16 上午9:36:21           黄忠                     Initial
	 **********************************************************************
	 */
	List<Map> querySQLByPage(String sqlKey, Integer pageSize, Integer pageNum, String conditionSql, List params) throws Exception;
	
}
